package com.example.mall.user.api.service;

import com.example.mall.user.api.entity.MallUser;
import com.example.mall.vo.MallUserVO;
import com.example.mall.util.PageQueryUtil;
import com.example.mall.util.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


@FeignClient(name = "mall-user-core")
public interface MallUserService {

    @PostMapping("/user/getMallUsersPage")
    PageResult getMallUsersPage(@RequestBody PageQueryUtil pageUtil);

    @PostMapping("/user/register")
    String register(@RequestParam("loginName") String loginName,
                    @RequestParam("password") String password);

    @PostMapping("/user/updateUserInfo")
    MallUserVO updateUserInfo(@RequestBody MallUser mallUser);

    @PostMapping("/user/lockUsers")
    Boolean lockUsers(@RequestParam("ids") Integer[] ids,
                      @RequestParam("lockStatus") int lockStatus);

    @PostMapping("/user/selectByLoginNameAndPasswd")
    MallUser selectByLoginNameAndPasswd(@RequestParam("loginName") String loginName,
                                        @RequestParam("password") String password);
}
